var appData = getApp().globalData;
var htName = ['宜尚酒店宁波联丰中路店'];
Page({
  data: {
    stu: appData.user,
    sUrl: appData.sUrl,
    bottonClr: ["#fff", "#fff", "#fff", "#fff", "#fff", "#fff", "#fff"],
  },

  onShow: function () {
    console.log(appData.user)
  },

  onLoad: function (e) {
    var gender, u = appData.user;
    gender = u.gender == 1 ? '先生' : u.gender == 2 ? '小姐' : '未填';
    this.setData({setArr:[
      { id: "1", name: "姓名", info: u.name, margin: "0" },
      { id: "2", name: "称呼", info: gender, margin: "0" },
      { id: "3", name: "手机", info: u.phone, margin: "0" },
      { id: "4", name: "注册时间", info: u.date.split(' ')[0], margin: "0" },
      { id: "5", name: "会员卡号", info: u.vip || '未绑定', margin: "30" },
      { id: "6", name: "本店信息", info: htName[appData.hotel], margin: "0" },
    ]})
  },

  //*****************************************************************************//
  CA: function (e) {this.setData({ [`bottonClr[${e.currentTarget.id}]`]: "#ddd"})},
  CB: function (e) {this.setData({ [`bottonClr[${e.currentTarget.id}]`]: "#fff"})},
  //*****************************************************************************//
  onShareAppMessage: function () {

  }
})